QuickTime 4 API Documentation

Inside Macintosh: More Macintosh Toolbox

Previous | Chapter Top | Chapter Contents | Next |

Getting Information About Components

Your application can get the registration information for any component using the GetComponentInfo function. You can use the GetComponentIconSuite function to get a handle to the component's icon suite, if any.

In addition, for components to which your application already has a connection, your application can obtain the component's version number and also determine whether the component supports a particular request by using the GetComponentVersion and ComponentFunctionImplemented functions.

GetComponentInfo

The GetComponentInfo function returns all of the registration information for a component. Your application specifies the component with a component identifier returned by the FindNextComponent function. The GetComponentInfo function returns information about the component in a component description record. The GetComponentInfo function also returns the component's name, information string, and icon. (To get a handle to the component's icon suite, if it provides one, use the GetComponentIconSuite function.)

A component provides this registration information when it is registered with the Component Manager.

FUNCTION GetComponentInfo (aComponent: Component;
                                         VAR cd: ComponentDescription;
                                         componentName: Handle;
                                         componentInfo: Handle;
                                         componentIcon: Handle): OSErr;
aComponent
A component identifier that specifies the component for the operation. Your application obtains a component identifier from the FindNextComponent function. If your application registers a component, it can also obtain a component identifier from the RegisterComponent or RegisterComponentResource function.
You may supply a component instance rather than a component identifier to this function. (If you do so, you must coerce the data type appropriately.) Your application can obtain a component instance from the OpenComponent function or the OpenDefaultComponent function.
cd
A component description record. The GetComponentInfo function returns information about the specified component in a component description record.
componentName
An existing handle that is to receive the component's name. If the component does not have a name, the GetComponentInfo function returns an empty handle. Set this field to NIL if you do not want to receive the component's name.
componentInfo
An existing handle that is to receive the component's information string. If the component does not have an information string, the GetComponentInfo function returns an empty handle. Set this field to NIL if you do not want to receive the component's information string.
componentIcon
An existing handle that is to receive the component's icon. If the component does not have an icon, the GetComponentInfo function returns an empty handle. Set this field to NIL if you do not want to receive the component's icon.

DESCRIPTION

The GetComponentInfo function returns information about the specified component in the cd , componentName , componentInfo , and componentIcon parameters.

RESULT CODES

noErr

0

No error

invalidComponentID

-3000

No component with this component identifier

SEE ALSO

For information on the component description record, see The Component Description Record . For information on the FindNextComponent function, see FindNextComponent . For information on registering components, see "Registering Components," .

For an example of the use of the GetComponentInfo function, see Listing 3 .

GetComponentIconSuite

The GetComponentIconSuite function returns a handle to the component's icon suite (if it provides one).

FUNCTION GetComponentIconSuite (aComponent: Component;
                                          VAR iconSuite: Handle): OSErr;
aComponent
A component identifier that specifies the component for the operation. Your application obtains a component identifier from the FindNextComponent function. If your application registers a component, it can also obtain a component identifier from the RegisterComponent or RegisterComponentResource function.
iconSuite
GetComponentIconSuite returns, in this parameter, a handle to the component's icon suite, if any. If the component has not provided an icon suite, GetComponentIconSuite returns NIL in this parameter.

DESCRIPTION

The GetComponentIconSuite function returns a handle to the component's icon suite. A component provides to the Component Manager the resource ID of its icon family in the optional extensions to the component resource. Your application is responsible for disposing of the returned icon suite handle.

SPECIAL CONSIDERATIONS

The GetComponentIconSuite function is available only in version 3 of the Component Manager.

RESULT CODES

noErr

0

No error

invalidComponentID

-3000

No component with this component identifier

SEE ALSO

For information about icon suites and icon families, see the chapter "Icon Utilities" in this book.

GetComponentVersion

The GetComponentVersion function returns a component's version number.

FUNCTION GetComponentVersion (ci: ComponentInstance): LongInt;
ci
The component instance from which you want to retrieve version information. Your application obtains the component instance from the OpenDefaultComponent or OpenComponent function.

DESCRIPTION

The GetComponentVersion function returns a long integer containing the version number of the component you specify. The high-order 16 bits represent the major version, and the low-order 16 bits represent the minor version. The major version specifies the component specification level; the minor version specifies a particular implementation's version number.

ComponentFunctionImplemented

The ComponentFunctionImplemented function allows you to determine whether a component supports a specified request. Your application can use this function to determine a component's capabilities.

FUNCTION ComponentFunctionImplemented (ci: ComponentInstance;
                                          ftnNumber: Integer)
                                         : LongInt;
ci
A component instance that specifies the connection for this operation. Your application obtains the component instance from the OpenDefaultComponent or OpenComponent function.
ftnNumber
A request code value. See Inside Macintosh: QuickTime Components for information about the request codes supported by the components supplied by Apple with QuickTime. For other components, see the documentation supplied with the component for request code values.

DESCRIPTION

The ComponentFunctionImplemented function returns a long integer indicating whether the component supports the specified request. You can interpret this long integer as if it were a Boolean value. If the returned value is TRUE , the component supports the specified request. If the returned value is FALSE , the component does not support the request.


© 1999 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next